package com.mt.restaurant.service.material;

import com.mt.common.core.web.base.PageDTO;
import com.mt.common.core.web.base.PageResultDTO;
import com.mt.restaurant.entity.material.MaterialOrder;
import com.mt.restaurant.entity.material.OrderMaterialRelation;
import com.mt.restaurant.entity.material.SupplyMaterial;

import java.util.List;

public interface OrderMaterialRelationService {
    /**
     * 根据分页参数查询订单材料关系集合
     *
     * @param pageDTO 分页条件
     */
    public PageResultDTO findOrderMaterialRelations(PageDTO pageDTO);

    /**
     * 查询全部订单材料关系集合
     */
    public List<OrderMaterialRelation> findAllOrderMaterialRelations();

    /**
     * 根据名称查询订单材料关系集合(只提取ID 和 Name)
     *
     * @param orderMaterialRelationName 名称
     */
    public List<OrderMaterialRelation> findOrderMaterialRelationsWithIdNameByName(String orderMaterialRelationName);

    /**
     * 查询所有订单材料关系集合(只提取ID 和 Name)
     */
    public List<OrderMaterialRelation> findAllOrderMaterialRelationsWithIdName();

    /**
     * 根据ID查询指定的订单材料关系(只提取ID 和 Name)
     *
     * @param orderMaterialRelationId Id
     */
    public OrderMaterialRelation findOrderMaterialRelationsWithIdNameById(Long orderMaterialRelationId);

    /**
     * 根据ID查询指定的订单材料关系
     *
     * @param orderMaterialRelationId Id
     */
    public OrderMaterialRelation findOrderMaterialRelation(Long orderMaterialRelationId);

    /**
     * 根据ID查询指定的订单材料关系(包含外键)
     *
     * @param orderMaterialRelationId Id
     */
    public OrderMaterialRelation findOrderMaterialRelationWithForeignName(Long orderMaterialRelationId);

    /**
     * 根据材料订单将对应的材料查出
     *
     * @param materialOrderList
     * @return
     */
    public List<OrderMaterialRelation> findOrderMaterialsByOrder(List<MaterialOrder> materialOrderList);

    public List<OrderMaterialRelation> findOrderMaterialsByOrderId(Long materialOrderId);

    /**
     * 新增订单材料关系
     *
     * @param orderMaterialRelation 实体对象
     */
    public OrderMaterialRelation saveOrderMaterialRelation(OrderMaterialRelation orderMaterialRelation);

    /**
     * 批量新增订单材料关系
     * @param orderId
     * @param supplyMaterialList
     * @return
     */
    public List<OrderMaterialRelation> saveOrderMaterialRelations(Long orderId, List<SupplyMaterial> supplyMaterialList);

    /**
     * 更新订单材料关系
     *
     * @param orderMaterialRelation 实体对象
     */
    public OrderMaterialRelation updateOrderMaterialRelation(OrderMaterialRelation orderMaterialRelation);

    public OrderMaterialRelation updateOrderMaterialRelationStatus(List<OrderMaterialRelation> orderMaterialRelations);

    public void returnOrderMaterial(Long orderMaterialRelationId);

    /**
     * 根据ID删除订单材料关系
     *
     * @param orderMaterialRelationId ID
     */
    public void deleteOrderMaterialRelation(Long orderMaterialRelationId);

    public void deleteOrderMaterialRelationByOrderId(Long MaterialOrderId);


}

